/*
 * Created by SharpDevelop.
 * User: rkeeter
 * Date: 8/5/2008
 * Time: 10:33 AM
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System;
using NUnit.Framework;
using MagicApp.Data;
using MagicApp.Services;
using System.Collections.Generic;

namespace MagicApp.Testing
{
	/// <summary>
	/// Description of GameEngineTests.
	/// </summary>
	[TestFixture]
	public class GameEngineTests
	{

		public GameEngineTests()
		{
			
		}
		[Test]
		public void CreateGame_Should_Create_a_Game_with_Three_Users()
		{
            //initialize a new game engine
			GameEngine gameEngine =
				new GameEngine(new DeckEngine(new DummyCardRepository()),
				               new GameService(new DummyGameRepository()));

		   //Create player entitys to get put into the bag                                       
		   PlayerEntity p1 = new PlayerEntity(new User("matt"),gameEngine.De.GetDeck("sammys"));
		   PlayerEntity p2 = new PlayerEntity(new User("matt"),gameEngine.De.GetDeck("sammys"));
		   PlayerEntity p3 = new PlayerEntity(new User("matt"),gameEngine.De.GetDeck("sammys"));
		   
           //Create a new list of player entities
		   IList<PlayerEntity> players = new List<PlayerEntity>();

            //add entities to the list
           players.Add(p1);
           players.Add(p2);
           players.Add(p3);

            //Pass the game engine the name of the game and the player entities
		   gameEngine.CreateGame("test",players);

		   Assert.AreEqual(3, gameEngine.CurrentGame.Players.Count, "should have been three");
		   
		}
	}
}
